import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import Login from "@/pages/login";
import Register from "@/pages/register";
import NoFound from "@/pages/noFound";
import Page from "@/pages/layout/page";

function App() {
  return (
    <Router>
      <Switch>
        {/* 一级路由 */}
        <Route path="/login" component={Login} />
        <Route path="/register" component={Register} />
        <Route path="/404" component={NoFound} />
        <Route
          path="/"
          // component={Page}
          render={(props: any) => {
            return <Page {...props} />;
          }}
        />
        <Route component={NoFound} />
      </Switch>
    </Router>
  );
}

export default App;
